﻿using NCS.IConnect.Core.WebApi.Description;
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using NCS.IConnect.Core;

namespace NCS.IConnect.Core.WebApi
{
    /// <summary>
    /// Class SampleDataInitializer
    /// </summary>
    public class SampleDataInitializer
    {
        /// <summary>
        /// Set sample data.
        /// </summary>
        /// <param name="register">Initialize sample data for web API documentation generation.</param>
        public static void SetSampleData(ISampleRegister register)
        {
            var allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures).OrderBy(it => it.Name);
            var cultureItems = allCultures.Select(
                it =>
                    new CultureItem
                    {
                        Lcid = it.LCID,
                        Name = it.Name,
                        NativeName = it.NativeName,
                        DisplayName = it.DisplayName,
                        EnglishName = it.EnglishName
                    }).ToArray();

            register.SetSample(cultureItems);
        }

    }
}
